<?php
namespace api\modules\v1\controllers;

use api\common\controllers\AController;
use common\records\ChargeRule;
use yii\data\ActiveDataProvider;

class ChargeRuleController extends AController
{
    public $modelClass = 'common\records\ChargeRule';
    /**
     * @api {get} /v1/chargerules 支付规则列表
     * @apiVersion 1.0.0
     * @apiName index
     * @apiGroup Comment
     *
     *
     */
    public function actionIndex()
    {
        $query = ChargeRule::find()->select(['id','money','coin','photo'])->where([]);
        return new ActiveDataProvider([
            'query' => $query,
            'pagination' => [
                'pageSize' => 10,
            ],
            'sort' => [
                'defaultOrder' => [
                    'id' => SORT_ASC
                ]
            ]
        ]);
    }
}
